package gui;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class SensorSelectorDialog extends JDialog {
    private JPanel contentPane;
    private JButton buttonOK;
    private JRadioButton tempucherSensorButton;
    private JRadioButton switcherButton;

    public SensorSelectorDialog() {
        setTitle("Emulator selecter");
        setContentPane(contentPane);
        setModal(true);
        getRootPane().setDefaultButton(buttonOK);
        final JDialog _this = this;
        buttonOK.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                _this.setVisible(false);
                if (tempucherSensorButton.isSelected())
                    TempretureSensorForm.run();
                else
                    SwitcherForm.run();
            }
        });
    }

    public static void main(String[] args) {
        SensorSelectorDialog dialog = new SensorSelectorDialog();
        dialog.pack();
        dialog.setLocation(500, 100);
        dialog.setVisible(true);
    }
}
